/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.oai.repositoryManager.items;

import cz.mzk.oai.repositoryManager.EntityNotFoundException;
import cz.mzk.oai.repositoryManager.EntityPresentException;
import cz.mzk.oai.repositoryManager.IncorrectEntityException;
import cz.mzk.oai.repositoryManager.MetadataFormat;
import cz.mzk.oai.repositoryManager.collections.CollectionEntity;
import cz.mzk.oai.repositoryManager.oaiId.OaiIdentifierEntity;
import cz.mzk.oai.repositoryManager.records.RecordEntity;
import cz.mzk.oai.repositoryManager.sets.SetEntity;
import java.util.List;

/**
 *
 * @author rehan
 */
public interface ItemManager {

    public ItemEntity createItem(OaiIdentifierEntity id, CollectionEntity col) throws EntityPresentException;

    public ItemEntity findByOaiId(OaiIdentifierEntity oaiId) throws EntityNotFoundException;

    public List<ItemEntity> findByCollection(CollectionEntity col);

    public List<ItemEntity> findBySetAndFormat(SetEntity set, MetadataFormat format);

    public List<ItemEntity> findByFormat(MetadataFormat format);

    public void setCollection(ItemEntity item, CollectionEntity collection) throws EntityNotFoundException, IncorrectEntityException;

    public void setRecord(ItemEntity item, MetadataFormat format, RecordEntity record) throws EntityNotFoundException, IncorrectEntityException;

    //also remove records here? probably yes
    public void removeItem(ItemEntity item) throws EntityNotFoundException, IncorrectEntityException;
}
